var order500 = function (orderType,pay,stack) {
    if(orderType === 1 && pay){
        console.log("购买500定金，反100优惠券");
    }else {
        order200(orderType,pay,stack)
    }
}
var order200 = function (orderType,pay,stack) {
    if(orderType === 2 && pay){
        console.log("购买200定金，反50优惠券");
    }else {
        orderNormal(orderType,pay,stack)
    }
}
var orderNormal = function (orderType,pay,stack) {
    if(stack > 0) {
        console.log("无优惠购买产品");
    }else {
        console.log("没有库存啦");
    }
}

order500(1,true,2)
order500(1,false,2)
order500(2,false,2)
order500(2,true,2)
order500(3,false,0)
order500(3,false,2)